package Entity;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

public class Pattern {

    private String name;
    private char type;
    List<Question> questions = new ArrayList<>();

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof Pattern)) return false;
        Pattern pattern = (Pattern) o;
        return getType() == pattern.getType() && Objects.equals(getName(), pattern.getName()) && Objects.equals(getQuestions(), pattern.getQuestions());
    }

    @Override
    public int hashCode() {
        return Objects.hash(getName(), getType(), getQuestions());
    }

    public Pattern(){}
    public Pattern(String name, char type,List<Question> questions) {
        this.name = name;
        this.type = type;
        this.questions = questions;
    }
    public void setQuestions(List<Question> questions) {
        this.questions = questions;
    }
    public List<Question> getQuestions() {
        return questions;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public char getType() {
        return type;
    }
    public void setType(char type) {
        this.type = type;
    }
}
